layui.define(["jquery"], function (exports) {
    "use strict";

    var $ = layui.$;

    var style_str = 
`.jmAvatar {
    background-color: #f8f8f8 !important;
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #16b777;
    position: relative;
    overflow: hidden;
}

.jmAvatar:hover {
    cursor: pointer
}

.jmAvatar * {
    font-size: 32px;
    font-weight: 600;
}

.jmAvatar>img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
}

.jmAvatar.radius-full {
    border-radius: 50%;
}

.jmAvatar.xl {
    border-radius: 10%;
}

.jmAvatar.xxl {
    border-radius: 20%;
}

.jmAvatar.xxxl {
    border-radius: 35%;
}

.jmAvatar.img-size-s img {
    max-width: 40%;
    max-height: 40%;
}

.jmAvatar.img-size-m img {
    max-width: 65%;
    max-height: 65%;
}

.jmAvatar.xs {
    width: 24px;
    height: 24px;
}

.jmAvatar.xs * {
    font-size: 16px;
}

.jmAvatar.sm {
    width: 40px;
    height: 40px;
}

.jmAvatar.sm * {
    font-size: 25px;
}

.jmAvatar.lg {
    width: 80px;
    height: 80px;
}

.jmAvatar.lg * {
    font-size: 55px;
}

.jmAvatar.xl {
    width: 128px;
    height: 128px;
}

.jmAvatar.xl * {
    font-size: 100px;
}`

    $('head').append(`<style>${style_str}</style>`)

    var jmAvatar = {
        click: function (callback) {
            $(".jmAvatar").on("click", function () {
                callback(this)
            })
        }
    }


    exports('jmAvatar', jmAvatar); // 输出模块
});  